-
-
Notifications
You must be signed in to change notification settings - Fork 206
Changes between main and next for review #2421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
krlmlr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid to me, by and large. Appreciate a second pair of eyes.
| if (lifecycle::is_present(directed)) { | ||
| if (directed) { | ||
| lifecycle::deprecate_soft( | ||
| "2.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and everywhere:
| "2.2.0", | |
| "3.0.0", |
| #' centr_degree(g, normalized = FALSE)$centralization / | ||
| #' centr_degree_tmax(g, loops = "twice") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember I wasn't sure about this. For centr_degree(), the default is "twice" IIRC. Is then the same loops value needed in the denominator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is correct.
| ) | ||
| } | ||
| 0L | ||
| # Catch all errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also go into main .
| if (!is(with, "igraph_rewiring_method")) { | ||
| cli::cli_abort( | ||
| "{.arg with} must be an igraph rewiring method, | ||
| "{.arg with} must be an igraph rewiring method, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in main.
| #' @param directed Boolean.Whether to consider the directions of edges. | ||
| #' The default, `TRUE` means that edge directions will be considered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #' @param directed Boolean.Whether to consider the directions of edges. | |
| #' The default, `TRUE` means that edge directions will be considered. | |
| #' @param directed Boolean. Whether to consider the directions of edges. | |
| #' The default, `TRUE` means that edge directions will be considered. |
| #' @rdname degree | ||
| #' @export | ||
| #' @cdocs igraph_maxdegree | ||
| max_degree <- maxdegree_impl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could ask Copilot, could manually backport to main .
Two more functions that were forgotten: mean_distance() and sample_spanning_tree() .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR contains essential differences between the main and next branches for review. The changes primarily focus on updating function signatures, parameter names, and implementations to align with underlying igraph C library updates.
Key changes:
- Standardization of parameter names (e.g.,
directed→mode,loopsfrom boolean to character) - Updates to match C library API changes (attribute handling, function signatures)
- Addition of new function parameters and deprecation of old ones
Reviewed Changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-structural-properties.R | Updates test parameters to use new loop handling syntax |
| tests/testthat/test-simple.R | Adds test for is_simple() with directed parameter |
| tests/testthat/test-interface.R | Adds snapshot tests for incident() function |
| tests/testthat/test-centrality.R | Adds warning suppression for eigen_centrality() |
| tests/testthat/test-aaa-auto.R | Removes tests for deprecated functions, updates parameter names |
| tests/testthat/_snaps/*.md | Updates snapshots to match new function behaviors and error messages |
| src/rinterface_extra.c | Major updates to match C library API changes for attributes and functions |
| R/*.R | Updates R function signatures, adds deprecations, parameter renaming |
| PROTECT(app=R_igraph_strvector_to_SEXP(tmprec->value.as_strvector)); | ||
| break; | ||
| default: | ||
| break; |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of a default case that does nothing could lead to app being used uninitialized if an unexpected attribute type is encountered. Consider either initializing app to R_NilValue before the switch, or handling the default case with an error.
| break; | |
| igraph_error("Unknown attribute type, internal error", __FILE__, __LINE__, | |
| IGRAPH_EINVAL); | |
| return R_NilValue; |
| } | ||
|
|
||
| igraph_error_t R_igraph_interrupt_handler(void *data) { | ||
| igraph_bool_t R_igraph_interrupt_handler(void) { |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type changed from igraph_error_t to igraph_bool_t, and the function signature removed the void *data parameter. Ensure all call sites have been updated accordingly to match this new signature.
| #' `"twice"` (the default) counts each loop edge twice in undirected graphs | ||
| #' and once in directed graphs. |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 883 is missing proper punctuation. It should either end with a period or be properly connected to line 882. The current formatting suggests it's a continuation but lacks proper grammatical structure.
| #' `"twice"` (the default) counts each loop edge twice in undirected graphs | |
| #' and once in directed graphs. | |
| #' `"twice"` (the default) counts each loop edge twice in undirected graphs and once in directed graphs. |
| #' `"twice"` counts each loop edge twice in undirected graphs. | ||
| #' and once in directed graphs. |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 394 appears orphaned from the previous line's structure. It should either be joined to line 393 or reformatted as a continuation of the bullet point structure.
| #' `"twice"` counts each loop edge twice in undirected graphs. | |
| #' and once in directed graphs. | |
| #' `"twice"` counts each loop edge twice in undirected graphs and once in directed graphs. |
These are the essential difference between the
mainandnextbranches. This is not intended to be merged, just as a review tool.Do any of these differences look suspicious? Let's discuss here and resolve.
Generated with:
@szhorvat @schochastics: We do benefit from taking a closer look here, but we will also catch errors later. I'll review too.